package com.ruoyi.interviews.mytask;

import com.ruoyi.interviews.service.IInterviewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class MyTask {
    @Autowired
    private IInterviewsService interviewsService;
   @Scheduled(cron = "0 0 0 1/30 * ?")
//@Scheduled(cron = "0/30 * * * * ?")
    public void Task(){
    System.out.println("定时任务开始了");
        interviewsService.deleteAll();
    }
}
